#ifndef _POISSONDISKs_H
#define	_POISSONDISKs_H

#include "Point.h"
#include <vector>

using namespace std;

class PoissonDisks {

private:

    // A data field for the minimum distance.
    double minDistance;

    // The current number of acceptable Points we have
    int currNum;

    // The maximum number of disks
    int maxDisks;

    // The height of the bounding rectangle
    int height;

    // The width of the bounding rectangle
    int width;

    // We need to keep track of all the points generated. We will use the STL,
    // probably a linked list?
    vector<Point*> allPoints;

public:

    // We want to make a new object called PoissonDisks (think of it as a collection
    // of circles with the center as a Point object, ie: a PoissonDisk, and none of
    // the Points can be within the radius of another PoissonDisk)
    // It will have the parameters:
    //      numDisks: number of PoissonDisks we want (ie: number of points we want)
    //      maxDist: the minimum distance each point must be away from each other
    //               ie: the radius of each PoissonDisk
    //      maxX: maximum x value of the Points (ie: the max width)
    //      maxY: maximum y value of the Points (ie: the max height)
    PoissonDisks(int numDisks, double minDist, int maxX, int maxY);

    // The destructor
    ~PoissonDisks() 
    {
        allPoints.clear();
    };

    // Generate all the points!
    void generateDisks();

    // Checks if a new Point is "far enough" from all the other points. You'll have
    // to iterated through allPoints and check the distance for each one with the
    // newly added point.
    bool farEnough(Point * newP);

    // Checks the distance between two points (We might have to use a pointer
    // to the Point instead of the Point itself. Check if this works, though)
    double distance(Point * p1, Point * p2);

    // Returns a vector containing the generated points
    vector<Point*> getPoints();

    // For debugging: a function to print out all the points generated, along
    // with the point's X and Y coordinates.
    void printPoints();

};


#endif	/* _POISSONDISKs_H */

